Rotating URL website Code
Rotating URL website Code
am 16.01.2008 18:41:56 von Sibine
Hi all,
I've searched this to death but didn't find much.
Basically we have a plasma screen in our office which has to look at
about 4 different websites (bbc news etc) on a regular basis.
I wrote a nice little array which half works but doesn't load the
pages properly. Code is:
$pages = array(
'http://nerws.google.co.uk','http://www.sky.com/news','http: //
www.bbc.co.uk/news');
shuffle($pages);
include($pages[0]);
?>
Basically after 60 seconds I'd like to randomly show one of the news
websites.
If anyone can help point out where I'm going wrong or a better way to
do this it would be excellent. I'd like to learn how to fix this, as
well as find a solution so anyone willing to offer a little tutorial
would be most appreciated.
Thanks
Si.
Re: Rotating URL website Code
am 16.01.2008 18:48:05 von Sibine
I've done some further work on this and realise that its loading the
URLs in the same page and thus thats why CSS and some images don't
work as it looks for them on my server (which they obviously aren;t).
I guess the best way is to have this page running and basically it
auto changes another IE window by setting it to load it in a different
target?
Obviously I need to add the header reload/refresh so the script
continues to run, but I'm still trying to work that out too!
Re: Rotating URL website Code
am 16.01.2008 19:09:18 von Toby A Inkster
Sibine wrote:
> If anyone can help point out where I'm going wrong or a better way to do
> this it would be excellent.
Using Javascript and frames. Two frames. Very thin one at the top. Very
big one underneath. In the top frame, call a Javascript function every 60
seconds, that loads a URL into the bottom frame. Easy.
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 17 days, 5:21.]
Gnocchi all'Amatriciana al Forno
http://tobyinkster.co.uk/blog/2008/01/15/gnocchi-allamatrici ana/
Re: Rotating URL website Code
am 16.01.2008 20:52:22 von adwatson
If any of the sites have some sort of anti-frame javascript, you may
have problems - but worth trying. Another option may be to have four
(or however many) browser windows open to the correct pages, and some
sort of code on the actual computer to shuffle through them somehow...
---
www.NEXCESS.NET - Shared/Reseller Hosting
www.EliteRax.com - Dedicated Servers, Server Clusters
www.MaxVPS.com - Virtual Private Servers
- Great prices, Great service - check us out!
On Jan 16, 1:09 pm, Toby A Inkster
wrote:
> Sibine wrote:
> > If anyone can help point out where I'm going wrong or a better way to do
> > this it would be excellent.
>
> Using Javascript and frames. Two frames. Very thin one at the top. Very
> big one underneath. In the top frame, call a Javascript function every 60
> seconds, that loads a URL into the bottom frame. Easy.
>
> --
> Toby A Inkster BSc (Hons) ARCS
> [Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
> [OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 17 days, 5:21.]
>
> Gnocchi all'Amatriciana al Forno
> http://tobyinkster.co.uk/blog/2008/01/15/gnocchi-allamatrici ana/
Re: Rotating URL website Code
am 16.01.2008 21:46:14 von thyb0
adwatson wrote:
> If any of the sites have some sort of anti-frame javascript, you may
> have problems - but worth trying. Another option may be to have four
> (or however many) browser windows open to the correct pages, and some
> sort of code on the actual computer to shuffle through them somehow...
There might be some browser plugins/addons as well.
-thib´
Re: Rotating URL website Code
am 17.01.2008 11:26:44 von Sibine
Thanks very much for all your help. I'll try the frames out later and
see how it goes :)
Re: Rotating URL website Code
am 23.01.2008 10:27:11 von tamirdoron
On 17 ×× ××ר, 12:26, Sibine =
wrote:
> Thanks very much for all your help. I'll try the frames out later and
> see how it goes :)
try this one that I amended specially for you to work with Iframe...
You can drop the top menue and autostart the script.
==================== =====3D=
==================== =====3D=
=================3D
onClick=3D"clearTimeout(timerID)">Cycle Pages ..........
STOP
a> ..........
onClick=3D"clearTimeout(timerID)">Stop @ My PAGE
==================== =====3D=
===3D
Good luck